package com.xiaodu.validator.config;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;

/**
 * @author: dutianjie
 * @date: 2021/3/31
 * @version: v1.0.0
 * @description: 描述
 **/
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Documented
@Repeatable(value = FileSufixx.List.class)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = ValidatedFileSufixx.class)
public @interface FileSufixx {

    String value() default "docx";

    String message() default "上传的文件类型不对，请检查";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
    @Documented
    @Retention(RetentionPolicy.RUNTIME)
    @interface List {

        FileSufixx[] value();
    }
}
